import { createApp } from "vue";
import App from "./App.vue";
import * as Icons from "@element-plus/icons-vue";
import Vue3DraggableResizable from "vue3-draggable-resizable";
import "vue3-draggable-resizable/dist/Vue3DraggableResizable.css";
import kdlowcode from "./install";
import vuex from "@/store/index";
import router from "./router/router.js";
import directives from "./directives/index";

// import vuex from "@/store/index";
const app = createApp(App);
Object.keys(Icons).forEach((key) => {
  app.component(key, Icons[key]);
});
app
  .directive("hasPermision", {
    mounted(el, { value }) {
      const hash = {
        0: "增加",
        1: "删除",
        2: "修改",
        3: "查看",
      };
      el.innerText = hash[value];
    },
  })
  .use(router) .use(vuex)
  // .use(directives)
  .use(kdlowcode)
  .use(Vue3DraggableResizable)
  .mount("#app");
 
